#!/bin/bash
if [ $UID -ne 0 ];then
	echo "need run as root user"
	exit -1
fi

rm -rf /opt/nginx
cp -R $PWD /opt/nginx

rm -rf /opt/nginx/.git
cp /opt/nginx/systemd/nginx-rtmp.service /lib/systemd/system/

systemctl disable nginx-rtmp
systemctl daemon-reload
systemctl enable nginx-rtmp
systemctl start nginx-rtmp

